export default {
  methods: {
    getParentName(name) { // 用于判断内页跳转则获取该内页的二级侧边栏
      let model;
      for (let i = 0; i < this.sidebarData.length; i++) {
        const childrenName = this.sidebarData[i].children.filter(ele => {
          if (ele.childrenName) {
            return ele.childrenName.indexOf(name) > -1;
          }
        });
        if (childrenName.length) {
          model = childrenName[0].name;
          return model;
        } else {
          model = name;
        }
      }
      return model;
    }
  }
};
